
<!DOCTYPE HTML>
<html lang="" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>CSS · GitBook</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        
        
        
    
    <link rel="stylesheet" href="../gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-highlight/website.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-search/search.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
    
        
    
        
    
        
    
        
    
        
    

        
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="1.css书写规范.html" />
    
    
    <link rel="prev" href="../html/3.html内容语义.html" />
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="Type to search" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    

    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="../">
            
                <a href="../">
            
                    
                    引言
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="../html/0.html.html">
            
                <a href="../html/0.html.html">
            
                    
                    HTML
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.1" data-path="../html/1.html整体结构.html">
            
                <a href="../html/1.html整体结构.html">
            
                    
                    HTML整体结构
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.2" data-path="../html/2.html代码格式.html">
            
                <a href="../html/2.html代码格式.html">
            
                    
                    HTML代码格式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.3" data-path="../html/3.html内容语义.html">
            
                <a href="../html/3.html内容语义.html">
            
                    
                    HTML内容语义
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter active" data-level="1.3" data-path="0.css.html">
            
                <a href="0.css.html">
            
                    
                    CSS
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.3.1" data-path="1.css书写规范.html">
            
                <a href="1.css书写规范.html">
            
                    
                    CSS书写规范
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.2" data-path="2.css命名规范.html">
            
                <a href="2.css命名规范.html">
            
                    
                    CSS命名规范
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.4" data-path="../js/0.javascript.html">
            
                <a href="../js/0.javascript.html">
            
                    
                    JavaScript
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.4.1" data-path="../js/1.javascript-es6.html">
            
                <a href="../js/1.javascript-es6.html">
            
                    
                    es6
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.5" data-path="../图片规范/图片规范.html">
            
                <a href="../图片规范/图片规范.html">
            
                    
                    图片规范
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6" data-path="../前端研发流程/前端研发流程.html">
            
                <a href="../前端研发流程/前端研发流程.html">
            
                    
                    前端研发流程
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7" data-path="../项目/0.项目.html">
            
                <a href="../项目/0.项目.html">
            
                    
                    项目
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.7.1" data-path="../项目/1.食尚购.html">
            
                <a href="../项目/1.食尚购.html">
            
                    
                    食尚购App
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.8" data-path="../文档/0.文档.html">
            
                <a href="../文档/0.文档.html">
            
                    
                    文档
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.8.1" data-path="../文档/1.食尚购.html">
            
                <a href="../文档/1.食尚购.html">
            
                    
                    食尚购App
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.2" data-path="../文档/2.门店EDI.html">
            
                <a href="../文档/2.门店EDI.html">
            
                    
                    门店EDI
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.3" data-path="../文档/3.掌中宝.html">
            
                <a href="../文档/3.掌中宝.html">
            
                    
                    掌中宝
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.4" data-path="../文档/4.食尚购小程序.html">
            
                <a href="../文档/4.食尚购小程序.html">
            
                    
                    食尚购小程序
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            Published with GitBook
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href=".." >CSS</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <h1 id="css-&#x7F16;&#x7801;&#x89C4;&#x8303;">CSS &#x7F16;&#x7801;&#x89C4;&#x8303;</h1>
<pre><code>
/* Bad example */

.goods-container .goods .item .name {

 ...

}

/* Good example */

.goods-container .goods-item-name {

 ...

}

.selector,

.selector-secondary,

.selector[type=&quot;text&quot;] {

 padding: 15px;

 margin-bottom: 15px;

 background-color: rgba(0,0,0,.5);

 box-shadow: 0 1px 2px #ccc, inset 0 1px 0 #fff;

}
</code></pre><blockquote>
<p>&#x4E00;&#x5F8B;&#x4F7F;&#x7528; tab &#x4F5C;&#x4E3A;&#x7F29;&#x8FDB;</p>
<p>&#x540E;&#x4EE3;&#x9009;&#x62E9;&#x5668;&#xFF08;descendant selector&#xFF09;&#x7684;&#x957F;&#x5EA6;&#x63A7;&#x5236;&#x5728; 3 &#x4E2A;&#x4EE5;&#x5185;&#xFF0C;&#x9632;&#x6B62;&#x4F18;&#x5148;&#x7EA7;&#x8FC7;&#x5927;&#x53CA;&#x6027;&#x80FD;&#x5F71;&#x54CD;</p>
<p>&#x4F7F;&#x7528;&#x524D;&#x7F00;&#x65B9;&#x5F0F;&#x4EE3;&#x66FF;&#x94FE;&#x5F0F;&#x9009;&#x62E9;&#x5668;&#xFF1A;.message.success =&gt; .message-success</p>
<p>&#x5C40;&#x90E8;&#x6837;&#x5F0F;&#x91C7;&#x7528;&#x540E;&#x4EE3;&#x9009;&#x62E9;&#x5668;&#x5B9A;&#x4E49;&#x4E14;&#x6839;&#x9009;&#x62E9;&#x5668;&#x4FDD;&#x8BC1;&#x5168;&#x5C40;&#x552F;&#x4E00;&#xFF1A;.goods-list =&gt; .goods-page .goods-list</p>
<p>&#x5F15;&#x7528;&#x56FE;&#x7247;&#x8DEF;&#x5F84;&#x65F6;&#x4E0D;&#x8981;&#x5E26;&#x4E0A;&#x9879;&#x76EE;&#x8DEF;&#x5F84;&#xFF0C;&#x4EE5;&#x76F8;&#x5BF9;&#x8DEF;&#x5F84;&#x4E3A;&#x4E3B;</p>
</blockquote>
<h3 id="&#x7EC4;&#x4EF6;&#x6837;&#x5F0F;&#x547D;&#x540D;&#x89C4;&#x5219;">&#x7EC4;&#x4EF6;&#x6837;&#x5F0F;&#x547D;&#x540D;&#x89C4;&#x5219;</h3>
<pre><code>
/* &#x6A21;&#x6001;&#x6846;&#x7EC4;&#x4EF6; */

.modal { ... }

/* &#x6A21;&#x6001;&#x6846;&#x6807;&#x9898; */

.modal-title { ... }

/* &#x68B0;&#x6001;&#x6846;&#x4E3B;&#x4F53; */

.modal-body { ... }
</code></pre><p>&#x6240;&#x6709;&#x5B50;&#x6837;&#x5F0F;&#x4F7F;&#x7528;&#x7EC4;&#x4EF6;&#x540D;&#x4E3A;&#x524D;&#x7F00;</p>
<p>&#x9879;&#x76EE;</p>
<hr>
<blockquote>
<p>Z5 &#x9879;&#x76EE;&#x4E2D; js &#x811A;&#x672C;&#x672B;&#x884C;&#x4E0D;&#x8981;&#x52A0;&#x6CE8;&#x91CA;&#x7B26;&#xFF0C;&#x5426;&#x5219;&#x4F1A;&#x62A5;&#x9519;</p>
<p>&#x7981;&#x6B62; js &#x8DE8;&#x4E1A;&#x52A1;&#x6A21;&#x5757;&#x6216;&#x529F;&#x80FD;&#x6A21;&#x5757;&#x8BBF;&#x95EE;</p>
<p>&#x7EDF;&#x4E00;&#x91C7;&#x7528; UTF-8 &#x7F16;&#x7801;</p>
<p>&#x4E0D;&#x540C;&#x9875;&#x9762;&#x5982;&#x679C;&#x8BF7;&#x6C42;&#x7684;&#x6570;&#x636E;&#x7ED3;&#x6784;&#x662F;&#x4E00;&#x6837;&#x7684;&#x4F7F;&#x7528;&#x540C;&#x4E00;&#x4E2A; controller &#x8BF7;&#x6C42;</p>
<p>&#x6BCF;&#x9875;&#x7528;&#x5230;&#x7684;&#x6837;&#x5F0F;&#x5B9A;&#x4E49;&#x52A0;&#x4E0A;&#x5168;&#x5C40;&#x552F;&#x4E00;&#x524D;&#x7F00;&#xFF0C;&#x9632;&#x6B62;&#x5F71;&#x54CD;&#x5176;&#x5B83;&#x9875;&#x9762;&#x6837;&#x5F0F;: <code>#shop_page .shop-selected-list</code></p>
<p>&#x516C;&#x5171; css &#x9875;&#x53EA;&#x6709;&#x4E00;&#x4E2A;&#xFF0C;&#x8FD9;&#x91CC;&#x7684;&#x6837;&#x5F0F;&#x5FC5;&#x987B;&#x96C6;&#x4E2D;&#x5B9A;&#x4E49;&#x5E76;&#x6DFB;&#x52A0;&#x5757;&#x6CE8;&#x91CA;&#xFF0C;&#x5E76;&#x6307;&#x660E;&#x9002;&#x7528;&#x8303;&#x56F4;</p>
<p>&#x6BCF;&#x4E2A;&#x529F;&#x80FD;&#x6A21;&#x5757;&#x8D77;&#x6709;&#x610F;&#x4E49;&#x7684;&#x540D;&#x5B57;&#xFF0C;&#x9644;&#x5E26;&#x7684; js &#x6587;&#x4EF6;&#x540D;&#x4E0E;&#x6A21;&#x5757;&#x540D;&#x4E00;&#x81F4;</p>
<p>ajax &#x8BF7;&#x6C42;&#x4E00;&#x5F8B;&#x5206;&#x51FA; service &#x5C42;</p>
<p>json &#x8BF7;&#x6C42;&#x4EE5; j &#x4E3A;&#x524D;&#x7F00;&#xFF1A;goods?m=jListByUid</p>
<p>&#x6837;&#x5F0F;&#x653E;&#x5728;&#x4E0A;&#x9762;&#xFF0C;&#x5185;&#x5BB9;&#x653E;&#x5728;&#x4E2D;&#x95F4;&#xFF0C;&#x811A;&#x672C;&#x653E;&#x5728;&#x4E0B;&#x9762;</p>
</blockquote>

                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="../html/3.html内容语义.html" class="navigation navigation-prev " aria-label="Previous page: HTML内容语义">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
                <a href="1.css书写规范.html" class="navigation navigation-next " aria-label="Next page: CSS书写规范">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"CSS","level":"1.3","depth":1,"next":{"title":"CSS书写规范","level":"1.3.1","depth":2,"path":"css/1.css书写规范.md","ref":"css/1.css书写规范.md","articles":[]},"previous":{"title":"HTML内容语义","level":"1.2.3","depth":2,"path":"html/3.html内容语义.md","ref":"html/3.html内容语义.md","articles":[]},"dir":"ltr"},"config":{"gitbook":"*","theme":"default","variables":{},"plugins":[],"pluginsConfig":{"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"}},"file":{"path":"css/0.css.md","mtime":"2019-10-12T05:14:43.052Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2020-07-02T00:51:07.028Z"},"basePath":"..","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="../gitbook/gitbook.js"></script>
    <script src="../gitbook/theme.js"></script>
    
        
        <script src="../gitbook/gitbook-plugin-search/search-engine.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search/search.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-sharing/buttons.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    </body>
</html>

